import url from "@/url.config"
import { request } from "../service"
export default ({ service, request, tools }) => ({
    Api_save(data) {
        //新建运维任务
        return request({
            url: url.ip1 + "/task/save",
            method: "post",
            data: data
        })
    },
    Api_findByPage(data) {
        //运维任务分页数据
        return request({
            url: url.ip1 + "/task/findByPagePc",
            method: "post",
            data: data
        })
    },
    Api_taskEdit(data) {
        //修改运维任务信息
        return request({
            url: url.ip1 + "/task/edit",
            method: "put",
            data: data
        })
    },
    Api_taskBindUser(data) {
        //任务分派人员
        return request({
            url: url.ip1 + "/task/taskBindUser",
            method: "post",
            data: data
        })
    },
    // 获取所有大区-项目组-运维点
    getAreaGetAllAreas() {
        return request({
            url: url.ip2 + "/area/getAllAreas",
            method: "get"
        })
    },
    // 分页查询用户列表
    userFindByPage(data) {
        return request({
            url: url.ip2 + "/user/findUserByAreaId",
            method: "post",
            data: data
        })
    },
    // 获取所有运维点
    areaFindPoint(level) {
        return request({
            url: url.ip2 + `/area/findPoint/${level}`
        })
    },
    // 根据组织机构获取其下所有运维点
    getAreaFindPoint(id) {
        return request({
            url: url.ip2 + "/area/findPointById/" + id,
            method: "get"
        })
    },
    // 区域分页查询
    AreaFindByPage(uid) {
        return request({
            url: url.ip2 + "/area/findAreasByUserId/" + uid,
            method: "get",
        })
    },
    task_findByPage(data) {
        //运维任务分页数据
        return request({
            url: url.ip1 + "/task/findByPage",
            method: "post",
            data: data
        })
    },
    task_findTodayDoneByPage(data) {
        //运维任务完成情况分页数据
        return request({
            url: url.ip1 + "/task/findTodayDoneByPage",
            method: "post",
            data: data
        })
    },
    Api_findOperationByPage(sid) {
        //查询维护完信息-运维成果反馈
        return request({
            url: url.ip1 + "/task/" + sid,
            method: "get",

        })
    },
    //根据当前登陆人的检测点id获取设备信息
    getEquipmentInfoByUserId(areaId) {
        return request({
            url: url.ip3 + "/equipment/getEquipmentInfoByUserId/" + areaId,
            method: "get",
        })
    },
    //运维计划制定点击id获取设备位置
    getFindAreaGeomByAreaId(positionId) {
        return request({
            url: url.ip2 + "/area/findAreaGeomByAreaId/" + positionId,
            method: "get",
        })
    },
    task_findEquipmentInfoListPoByPage(data) {
        //运维任务完成情况分页数据
        return request({
            url: url.ip1 + "/task/findEquipmentInfoListPoByPage",
            method: "post",
            data: data
        })
    },
    task_insertMaintenanceInstall(data) {
        //新增运维任务配置
        return request({
            url: url.ip1 + "/task/insertMaintenanceInstall",
            method: "post",
            data: data
        })
    },
    task_updateMaintenanceInstall(data) {
        //修改运维任务配置
        return request({
            url: url.ip1 + "/task/updateMaintenanceInstall",
            method: "post",
            data: data
        })
    },
    findMDictionaryInfo(data) {
        //查询烟气字典
        return request({
            url: url.ip1 + "/operation/findMDictionaryInfo",
            method: "post",
            data: data
        })
    },
    //烟气更换（get）
    smokeReplace(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/smokeReplace/" + areaId,
            method: "get",
        })
    },
    //烟气维修（get）
    smokeRepair(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/smokeRepair/" + areaId,
            method: "get",
        })
    },
    //烟气校准（get）
    driftCalibration(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/driftCalibration/" + areaId,
            method: "get",
        })
    },
    //巡检（get）
    findEquipmentOperationMaintenanceByPage(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/findEquipmentOperationMaintenanceByPage/" + areaId,
            method: "get",
        })
    },
    //水质更换（get）
    waterReplace(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/waterReplace/" + areaId,
            method: "get",
        })
    },
    //水质维修（get）
    waterRepair(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/waterRepair/" + areaId,
            method: "get",
        })
    },
    //水质校准（get）
    waterDriftCalibration(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/waterDriftCalibration/" + areaId,
            method: "get",
        })
    },
    //水质校验（get）
    checkListBy(areaId) {
        return request({
            url: url.ip1 + "/reportFormTask/checkListBy/" + areaId,
            method: "get",
        })
    },
    //查询排口
    saveChoiceEquipmentPo() {
        return request({
            url: url.ip1 + "/task/saveChoiceEquipmentPo",
            method: "get"
        })
    },
    //烟气维修（get）
    smokeRepairListDetail(areaId) {
        return request({
            url: url.ip1 + "/listDetails/smokeRepair/" + areaId,
            method: "get",
        })
    },
    //水质维修（get）
    waterRepairListDetail(areaId) {
        return request({
            url: url.ip1 + "/listDetails/waterRepair/" + areaId,
            method: "get",
        })
    },
    //烟气更换（get）
    smokeReplaceListDetails(areaId) {
        return request({
            url: url.ip1 + "/listDetails/smokeReplace/" + areaId,
            method: "get",
        })
    },
    //水质更换（get）
    waterReplaceListDetails(areaId) {
        return request({
            url: url.ip1 + "/listDetails/waterReplace/" + areaId,
            method: "get",
        })
    },
    //获取人员（get）
    findUserNameByEquipmentId(areaId) {
        return request({
            url: url.ip1 + "/task/findUserNameByEquipmentId/" + areaId,
            method: "get",
        })
    },
    task_updateExaminePo(data) {
        //用户审核
        return request({
            url: url.ip1 + "/task/updateExaminePo",
            method: "post",
            data: data
        })
    },
    task_findDistanceByPage(data) {
        //打卡距离分页数据
        return request({
            url: url.ip1 + "/task/findDistanceByPage",
            method: "post",
            data: data
        })
    },
    task_updateDistance(data) {
        //修改距离分页数据
        return request({
            url: url.ip1 + "/task/updateDistance",
            method: "post",
            data: data
        })
    },
    task_insertDistance(data) {
        //新增打卡距离配置
        return request({
            url: url.ip1 + "/task/insertDistance",
            method: "post",
            data: data
        })
    },
    task_removeDistanceById(id){
         return request({
             url:url.ip1+`/task/removeDistanceById/${id}`,
             method:"post"
         })
    }
})